-
Notifications
You must be signed in to change notification settings - Fork 18
Add onssrcchange/oncsrcchange events to RTCRtpReceiver #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I believe that receiver.onssrcchange can NOT be used to shim track.onunmute because onssrcchange fires at decode time while onunmute fires at packet reception time, and in Chrome we don't decode (audio) unless we have a sink |
My preference would be to resolve w3c/webrtc-pc#3077 first before merging this. |
I intend to present both at then next WG meeting and it sounds like we have agreement there. But to clarify this comment I made:
What I mean is that one of the use cases for unmute that has been used in examples is |
My understanding is SSRC lives in the RTP header, available as soon as an SRTP-authenticated packet arrives, long before any depacketization or codec decode.
Chrome is skipping more than decode absent a sink if this is true. This seems like an implementation optimization, and not something we want to standardize. I can't think of a reason other than implementation convenience to limit the API to when sinks exist. Conceptually, I'd expect the event to fire regardless of sink. |
Agree, my point is just that since UAs may do this then onssrcchange cannot substitute onunmute |
And we don’t want to disallow UAs from optimizing |
We also don't want to disallow UAs from being accurate. |
Sounds like we agree that "optimize versus accuracy" is in the UA territory meaning we cannot shim one of the APIs over the other which means onssrcchange is independent from onunmute |
Though it would be independent either way since decode != reception |
I don't think we can arrive at that. Both unmute and |
They happen at different times - unmute happens when receiving the first RTP packet (which FWIW is terrible for performance) is post-jitterbuffer and post-decode. And they solve different use-cases, |
This issue had an associated resolution in WebRTC October 2025 meeting – 21 October 2025 (WebRTC-extensions receiver.on[c/s]srcchange event):
|
Done. |
Co-authored-by: Jan-Ivar Bruaroey <[email protected]>
};</pre> | ||
<p> | ||
Whenever the {{RTCRtpContributingSource/source}} identifier is updated based on the last decoded frame, | ||
the [= user agent =] MUST [= queue a task =] to [= fire an event =] named {{RTCRtpReceiver/ssrcchange}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the same queued task ... append the following steps at the end: 1. fire ssrcchange if changed, 2. fire csrcchange if changed
the [= user agent =] MUST [= queue a task =] to [= fire an event =] named {{RTCRtpReceiver/ssrcchange}} | ||
if the SSRC changed and an event named {{RTCRtpReceiver/csrcchange}} if the CSRC changed. If both | ||
identifiers are changed based on the same decoded frame, both events fire in the same queued task. This | ||
ensures that both SSRC and CSRC information is exposed to the app at the same time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the time of the first event
Fixes #230.
To remind everyone, this was presented to the WG back in November of last year with resolution "RESOLUTION: Rough consensus on moving forward with events for csrc/ssrc changes, with concerns noted on related onunmute interop".
Regarding the onunmute discussion, Chrome has attempted to ship "remote track onunmute in response to RTP" but that had to be rolled back due to bugs detected at Stable, hopefully we can roll that forward again. I still believe that issue is largely tangential to this issue.
@koumiGoogle @taylor-b @jan-ivar
Preview | Diff